<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<script language="javascript" src="<%=basePath%>/editor/xheditor.js"
	type="text/javascript"></script>
<script language="javascript"
	src="<%=basePath%>/datePicker/WdatePicker.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
	$(function(){
		/* 新建栏目的ajax表单提交 */
		$('#newsSubmitBtn').click(function() {
			$("#newsForm").ajaxSubmit({success : function(data) {
				alert('修改成功!');
				location.reload();
			}});
			return false;
		});
	});
</script>

<div
	class="generalbox_header overview_veryunevenlargecolumn_width generalbox_header_heavy">
	<div class="box_leftheader generalbox_leftheader">
		<img class="inlineicon transparentpng" height="16" alt=""
			src="<%=basePath%>/images/document.png" width="16" />
		新闻修改 ${news.id }--${news.title }
	</div>
	<div class="clearer"></div>
</div>
<div
	class="generalbox_body generalbox_background_white overview_veryunevenlargecolumn_width">
	<div class="singlecontent_block">
		<form method="post" action="<%=basePath%>/news/updateNews" id="newsForm">
			<table width="100%" cellpadding="2" cellspacing="1" border="0">
				<tr>
					<td width="12%" class="pn-flabel pn-flabel-h">
						所属栏目：
					</td>
					<td colspan="1" width="38%" class="pn-fcontent">
						<s:select name="newsSort.id" list="newsSortList" headerKey="0" headerValue="栏目名称"
							listKey="id" listValue="name" theme="simple"/>
					</td>
					<td width="12%" class="pn-flabel pn-flabel-h">
						标题：
					</td>
					<td width="38%" class="pn-fcontent">
						<input type="text" size="45" name="news.title" value="${news.title }"/>
					</td>
				</tr>
				<tr>
					<td width="12%" class="pn-flabel pn-flabel-h">
						来源：
					</td>
					<td colspan="1" width="38%" class="pn-fcontent">
						<input type="text" size="35" name="news.from" value="${news.from }"/>
					</td>
					<td width="12%" class="pn-flabel pn-flabel-h">
						简短标题：
					</td>
					<td width="38%" class="pn-fcontent">
						<input type="text" size="45" name="news.shortTitle" value="${news.shortTitle }"/>
					</td>
				</tr>
				<tr>
					<td width="12%" class="pn-flabel pn-flabel-h">
						作者：
					</td>
					<td colspan="1" width="38%" class="pn-fcontent">
						<input type="text" value="${news.author }"
							size="35" name="news.author"/>
					</td>
					<td width="12%" class="pn-flabel pn-flabel-h">
						摘要：
					</td>
					<td colspan="3" width="38%" class="pn-fcontent">
						<textarea cols="31" rows="3"></textarea>
					</td>
				</tr>
				<tr>
					<td width="12%" class="pn-flabel pn-flabel-h">
						Tag标签：
					</td>
					<td colspan="1" width="38%" class="pn-fcontent">
						<input type="text" name="news.tag" size="28" value="${news.tag }"/>
						<span class="pn-fhelp">用,分割</span>
					</td>
					<td width="12%" class="pn-flabel pn-flabel-h">
						阅读权限：
					</td>
					<td colspan="1" width="38%" class="pn-fcontent">
						<select />
							<option value="0" selected="selected">
								不受限制
							</option>
							<option value="1">
								普通会员
							</option>
						</select>
					</td>
				</tr>
				<!-- 
								<tr>
									<td width="12%" class="pn-flabel pn-flabel-h">
										相关文章：
									</td>
									<td colspan="1" width="38%" class="pn-fcontent">
										<input type="text" maxlength="255" name="bean.relatedIds"
											size="35" maxlength="255" />
										<div class="pn-fhelp">
											填写文章ID，多篇文章用,分割
										</div>
									</td>
									<td width="12%" class="pn-flabel pn-flabel-h">
										允许评论：
									</td>
									<td colspan="1" width="38%" class="pn-fcontent">
										<input type="radio" id="_bean.allowComment_0" value="true"
											checked="checked" name="bean.allowComment" />
										<label for="_bean.allowComment_0">
											是
										</label>
										<input type="radio" id="_bean.allowComment_1" value="false"
											name="bean.allowComment" />
										<label for="_bean.allowComment_1">
											否
										</label>
									</td>
								</tr>
								<tr>
									<td width="12%" class="pn-flabel pn-flabel-h">
										是否草稿：
									</td>
									<td colspan="1" width="38%" class="pn-fcontent">
										<input type="radio" id="_bean.draft_0" value="true"
											name="bean.draft" />
										<label for="_bean.draft_0">
											是
										</label>
										<input type="radio" id="_bean.draft_1" value="false"
											checked="checked" name="bean.draft" />
										<label for="_bean.draft_1">
											否
										</label>
									</td>
									<td width="12%" class="pn-flabel pn-flabel-h">
										是否推荐：
									</td>
									<td colspan="1" width="38%" class="pn-fcontent">
										<input type="radio" id="_bean.recommend_0" value="true"
											name="bean.recommend" />
										<label for="_bean.recommend_0">
											是
										</label>
										<input type="radio" id="_bean.recommend_1" value="false"
											checked="checked" name="bean.recommend" />
										<label for="_bean.recommend_1">
											否
										</label>
									</td>
								</tr>
								 -->
				<tr>
					<td width="12%" class="pn-flabel">
						内容：
					</td>
					<td colspan="3" width="88%" class="pn-fcontent">
						<textarea class="xheditor-simple" name="news.content" rows="18"
							style="width: 630px" >${news.content }</textarea>
					</td>
				</tr>
				<tr>
					<td width="12%" class="pn-flabel pn-flabel-h">
						发布时间：
					</td>
					<td colspan="1" width="38%" class="pn-fcontent">
						<input type="text" name="news.created" size="35" value="${news.created }"
							onfocus="WdatePicker()" class="Wdate" readonly="true" />
						<div class="pn-fhelp">
							不填写则为当前时间
						</div>
					</td>
					<td width="12%" class="pn-flabel pn-flabel-h">
						外部链接：
					</td>
					<td colspan="1" width="38%" class="pn-fcontent">
						<input type="text" size="35" />
						<div class="pn-fhelp">
							链接直接使用该URL
						</div>
					</td>
				</tr>
				<input type="hidden" name="id" value="${news.id }"/>
				<tr>
					<td colspan="4" class="pn-fbutton">
						<input type="button" id="newsSubmitBtn" value="修改" />
						&nbsp;
						<input type="reset" value="重置" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>
<br />
<br />